#ifndef STATISTICS_H
#define STATISTICS_H
#include<string>
#include"opencv2/opencv.hpp"
#include<vector>
#include "common.h"
#include <chrono>

class Statistics
{
public:
	Statistics(const Door_Params& door,const TotalInfo& init_params, int mode=0, float threshold_ = 0.4f):door_params(door),total_info(init_params), threshold(threshold_)
	{
		if (mode == 1)
			total_info.limit_size = 4;
	}
	~Statistics(){}

	TotalInfo get_totoalinfo()const
	{
		return total_info;
	}

	InfoRect get_current_info()const
	{
		return info;
	}

	void update_info(InfoRect& info_new);
	void update_info(std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>* time_now = nullptr);
private:
	void update_id_info();
	void update_gender_info();
	void update_age_info();

private:
	InfoRect info;
	Door_Params door_params;
	int m_status=0;
	bool flag_statues = true;
	TotalInfo total_info;

	tm* previous_time = nullptr;
	float threshold;
};

#endif // !STATISTICS_H

